<% html_title(t(:label_administration), t('ldap_groups.synchronized_filters.plural'), h(@filter.name)) -%>

<%= error_messages_for @filter %>

<%= breadcrumb_toolbar(h(@filter.name)) do %>
  <li class="toolbar-item">
    <%= link_to({ action: :edit },
                class: 'button') do %>
      <%= op_icon('button--icon icon-edit') %>
      <span class="button--text"><%= t(:button_edit) %></span>
    <% end %>
  </li>
  <li class="toolbar-item">
    <%= link_to({ action: :destroy_info },
                class: 'button -danger') do %>
      <%= op_icon('button--icon icon-delete') %>
      <span class="button--text"><%= t(:button_delete) %></span>
    <% end %>
  </li>
<% end %>

<section class="admin--edit-section">
    <div class="attributes-key-value">
      <div class="attributes-key-value--key"><%= @filter.class.human_attribute_name(:name) %></div>
      <div class="attributes-key-value--value-container">
        <div class="attributes-key-value--value">
          <span><%= @filter.name %></span>
        </div>
      </div>
      <div class="attributes-key-value--key"><%= @filter.class.human_attribute_name(:group_name_attribute) %></div>
      <div class="attributes-key-value--value-container">
        <div class="attributes-key-value--value">
          <span><%= @filter.group_name_attribute %></span>
        </div>
      </div>
      <div class="attributes-key-value--key"><%= @filter.class.human_attribute_name(:filter_string) %></div>
      <div class="attributes-key-value--value-container">
        <div class="attributes-key-value--value">
          <code><%= @filter.filter_string %></code>
        </div>
      </div>
      <div class="attributes-key-value--key"><%= t('ldap_groups.synchronized_groups.plural') %></div>
      <div class="attributes-key-value--value-container">
        <div class="attributes-key-value--value">
          <%= @filter.groups.count %>
        </div>
      </div>
    </div>
</section>

<section class="admin--edit-section">
<%= toolbar(title: t('ldap_groups.synchronized_groups.plural')) do %>
  <li class="toolbar-item">
    <%= link_to({ action: :synchronize },
                class: 'button') do %>
      <span class="button--text"><%= t('ldap_groups.label_synchronize') %></span>
    <% end %>
  </li>
<% end %>
  <%= cell ::LdapGroups::SynchronizedGroups::TableCell, @filter.groups, show_inline_create: false, deletable: false %>
</section>

